import parseTemplateTotokens from './parseTemplateToTokens.js'
import renderTemplate from './renderTemplate.js'
// import Scanner from './Scanner.js'
// import lookup from './lookup.js'


window.SSG_TEMPLATE = {
    render(templateStr, data) {

        // 将页面里的字符串html,解析为 tokens树
        let tokens = parseTemplateTotokens(templateStr)
        // 调用renderTemplate函数,让tokens函数变成dom函数.
        let domStr = renderTemplate(tokens, data);
        console.log('renderTemplate', domStr)
        return domStr;
    }
}